import request from '@/utils/request'

// 获取
export function queryList(listquery) {
  return request.post('/user/query', listquery)
}

// 获取
export function querySubscribeList(listquery) {
    return request.post('/subscribe/list', listquery)
}

export function createOrUpdateInfo(form) {
  return request.post('/user/createOrUpdate', form)
}

export function getUserById(id) {
  return request.post('/user/get', {id})
}

export function changeStatus(id, status) {
  return request.post('/user/changeStatus', { id, status })
}

export function changeMemberLevelStatus(id, status) {
  return request.post('/user/changeMemberLevelStatus', { id, status })
}

export function changeBalance(form) {
  return request.post('/user/changeBalance', form)
}


export function withdrawConfirm(form) {
  return request.post('/user/withdrawConfirm', form)
}
export function queryRecharge(listquery) {
  return request.post('/user/queryRecharge', listquery)
}

export function queryWithdraw(listquery) {
  return request.post('/user/queryWithdraw', listquery)
}

export function queryMemberLevel() {
  return request.post('/user/queryMemberLevel')
}

export function queryStatistics(listquery) {
  return request.post('/user/queryStatistics', listquery)
}

export function editMemberLevel(form) {
  return request.post('/user/createOrUpdateMemberLevel', form)
}


export function getTeamInfo(id) {
  return request.post('/user/getTeamInfo', {id})
}

export function getTeamMember(pid) {
  return request.post('/user/getTeamMember', {pid})
}
export function getStatus() {
  return {
    '0': '正常',
    '99': '禁用'
  }
}


export function getMyPushStrategy(data) {
    return request({
        url: '/user/pushStrategy/get',
        method: 'get',
        params: data,
    })
}

export function pushStateUpdate(data) {
    return request({
        // url: '/user/pushStrategy/update',
        url: '/push/setting/update',
        method: 'post',
        params: data
    })
}

export function getPushStateByTime(data) {
    return request({
        url: '/user/pushState/get',
        method: 'get',
        params: data,
    })
}

export function updatePushStateByTime(data) {
    return request({
        url: '/user/pushState/update',
        method: 'post',
        params: data
    })
}


export function getInviteList(data) {
    return request({
        url: '/invite/user/get',
        method: 'get',
        params: data,
    })
}

export function userOpenIdClear(data) {
    return request({
        url: '/user/reset',
        method: 'post',
        params: data
    })
}